﻿@model iMyRestaurent.Models.BookingDetailModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>BookingDetail</title>
    @NoCache.Instance.Javascript(Url, "~/Js/theme.js")
    @NoCache.Instance.Javascript(Url, "~/Js/core.js")
    @*<script src="@NoCache.Instance.Url(Url, "~/Scripts/jquery-1.4.1.min.js")" type="text/javascript"></script>*@
    @NoCache.Instance.Css(Url, "~/Js/popup.css")
    @NoCache.Instance.Javascript(Url, "~/Js/functionlib.js")

    
    @NoCache.Instance.Css(Url, "~/Content/Test/style.css")

    @NoCache.Instance.Javascript(Url, "~/Content/Test/jquery-1.2.6.min.js")
    @NoCache.Instance.Javascript(Url, "~/Content/Test/jquery.rater.js")
    @*<script src="@NoCache.Instance.Url(Url, "~/Scripts/jquery-1.4.1.min.js")" type="text/javascript"></script>*@
    <script type="text/javascript">
        $(function () {
            $('#testRater').rater({ postHref: '@Url.Action("Rate")' });
        });
    </script>

    <style>
        #opacity-box {
            background-color: rgba(235, 190, 181, 0.5);
            border-radius: 10px 10px 10px 10px;
            margin: 0 auto;
            padding: 20px;
            width:90%;
        }
        .button-style{
            background-color: rgba(243, 225, 147, 0.5);
            height:40px;
        }
        .textbox-popup
        {
            color: rgb(185,185,185);
        }
        </style>
</head>
<body>
@using (Html.BeginForm())
{
    
    <div id="opacity-box">
        <table width="1028" border="0" align="center" cellpadding="3" cellspacing="5">
            <tr>
                <td valign="top" colspan="4" align="center">
                    <div style="font-weight: bold; font-size:xx-large">Table Reservation Detail</div>
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.LocationName):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.LocationName)
                </td>
                <td valign="top" align="right">
                    
                </td>
                <td valign="top" align="left">
                    
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.MenuType):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.MenuType)
                </td>
                <td valign="top" align="right">
                    
                </td>
                <td valign="top" align="left">
                    
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.TableNo):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.TableNo)
                </td>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.iMyTableReserved)?
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.iMyTableReserved)
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.FullName):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.FullName)
                </td>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.IsOntime)?
                </td>
                <td valign="top" align="left">
                    @Html.CheckBoxFor(x => x.IsOntime)
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.Email):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.Email)
                </td>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.GuestRating)?
                </td>
                <td valign="top" align="left">
                    <div id="testRater" class="stat">
		                <label for="rating">Rating</label>
		                <div class="statVal">
			                <span class="ui-rater">
				                <span class="ui-rater-starsOff" style="width:90px;"><span class="ui-rater-starsOn" style="width:@(Model.RateSize)px"></span></span>
			                </span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.PhoneNumber):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.PhoneNumber)
                </td>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.BillAmount)?
                </td>
                <td valign="top" align="left">
                    @Html.TextBoxFor(x => x.BillAmount)
                </td>
            </tr>
             <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.NoOfGuests):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.NoOfGuests)
                </td>
                <td valign="top" align="right">
                   
                </td>
                <td valign="top" align="left">
                    
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.BookingDate):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.BookingDate)
                </td>
                <td valign="top" align="right">
                   
                </td>
                <td valign="top" align="left">
                    
                </td>
            </tr>
            <tr>
                <td valign="top" align="right">
                    @Html.LabelFor(x => x.TimeSlot):
                </td>
                <td valign="top" align="left">
                    @Html.DisplayFor(x => x.TimeSlot)
                </td>
                <td valign="top" align="right">
                   
                </td>
                <td valign="top" align="left">
                    
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="4">
                   <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="center">
                                <input type="button" name="submit" value="Change this reservation" class="button-style" />
                            </td>
                            <td align="center">
                                <input type="button" name="submit" value="Cancel this reservation" onclick="OnClickReservation('Cancel'); return false;"  class="button-style" />
                            </td>
                            <td align="center">
                                <input type="button" name="submit" value="Block guest" onclick="OnClickReservation('BlogGuest'); return false;" class="button-style" />
                            </td>
                            <td align="center">
                                <input type="button" name="submit" value="Report guest as no show" class="button-style" />
                            </td>
                            <td align="center">
                                <input type="button" name="submit" value="View history of reservation" class="button-style" />
                            </td>
                            <td align="center">
                                <input type="button" name="submit" value="Save & close" class="button-style" />
                            </td>
                        </tr>
                   </table>
                </td>
            </tr>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
        function OnClickReservation(objName) {
            var html = '';
            html += '<p>Reason to ' + objName + '</p>';
            html += '<p><input type="text" value="Cancel Reason" id="txt'+ objName +'" class="textbox-popup" onclick="ClearText(this);" /></p>';
            html += '<p><input type="button" value="No" id="button-style" /> <input type="button" value="Yes" id="btnYes" onclick="CallReservation(\'' + objName + '\');" /></p>';
            theme.ReservationBox.CancelReservationBox(html, objName + ' a Reservation');
        }

        function ClearText(obj) {
            obj.value = "";
        }

        function CallReservation(objName) {
            var obj = {};
            obj.TextInput = document.getElementById("txt" + objName).value;

            switch(objName){
                case "Cancel":
                    var url = '@Url.Action("CancelReservation")';

                    $.post(url,
                    obj,
                    function (data) {
                        // Get data and check
                        alert(data.ResultData);
                    },
                    'json'
                    );
                    break;
                case "BlogGuest":
                    var url = '@Url.Action("BlogGuestReservation")';

                    $.post(url,
                    obj,
                    function (data) {
                        // Get data and check
                        alert(data.ResultData);
                    },
                    'json'
                    );
                    break;
            }
            

	    }

    </script>
}
</body>
</html>
